package com.xpgk.mvc.deptStation;

import com.jfinal.log.Log;
import com.xpgk.annotation.Table;
import com.xpgk.mvc.base.BaseModel;
import com.xpgk.mvc.organizationLevel.OrganLevelRight;

/*** 岗位功能 model */

@SuppressWarnings("unused")
@Table(tableName = DeptStationRight.table_name)
public class DeptStationRight extends BaseModel<DeptStationRight> {

	private static final long serialVersionUID = 6761767368352810428L;

	private static final Log log = Log.getLog(DeptStationRight.class);

	public static final DeptStationRight dao = new DeptStationRight().dao();

	/**
	 * 表名称
	 */
	public static final String table_name = "sys_dept_station_right";

	/**
	 * 字段描述：该条数据添加人员is  字段类型：character varying 长度：32
	 */
	public static final String column_createId = "createId";
	/**
	 * 字段描述：该条数据添加时间  字段类型：datetime 长度：0
	 */
	public static final String column_createDate = "createDate";
	/**
	 * 字段描述：该条数据更新人员id  字段类型：character varying 长度：100
	 */
	public static final String column_updateId = "updateId";
	/**
	 * 字段描述：该条数据更新时间  字段类型：datetime 长度：0
	 */
	public static final String column_updateDate = "updateDate";
	
	/**
	 * 字段描述：主键 字段类型：character varying 长度：32
	 */
	public static final String column_ids = "ids";

	/**
	 * 字段描述：岗位ids 字段类型：character varying 长度：32
	 */
	public static final String column_stationIds = "stationIds";

	/**
	 * 字段描述：功能ids 字段类型：character varying 长度：32
	 */
	public static final String column_rightIds = "rightIds";
	
	/**
	 * 描述：获取子节点
	 */
	public static final String sqlId_rootNode = "sys.dept_station_right.rootNode";
	
	/**
	 * 描述：获取子节点
	 */
	public static final String sqlId_childNode = "sys.dept_station_right.childNode";

	/**
	 * 描述：联合 主键查询
	 */
	public static final String sqlId_findByIds = "sys.dept_station_right.findByIds";
	
	/**
	 * 描述：查询子节点数
	 */
	public static final String sqlId_countChild = "sys.dept_station_right.countChild";
	
	/**
	 * 描述：根据上级节点id和岗位查询子信息
	 */
	public static final String sqlId_childNodeByStation = "sys.dept_station_right.childNodeByStation";
	
	/**
	 * 描述：根据岗位ids查询所有去权限
	 */
	public static final String sqlId_findRightByStationIds = "sys.dept_station_right.findRightByStationIds";
	
	/**
	 * 联合查询
	 * @param rightIds
	 * @param stationIds
	 * @return
	 */
	public DeptStationRight findByIds(String rightIds, String stationIds) {
		String sql = getSqlMy(sqlId_findByIds);
		return findFirst(sql, rightIds, stationIds);
	}

}
